<?php
header("Content-type:text/html;charset=utf-8");
session_start();

//连接数据库
$server = 'localhost';
$user = 'root';
$psw = 'root';
$db = 'qq';
$conn = new PDO("mysql:host=$server;dbname=$db",$user,$psw);
$id = $_SESSION['id'];
//根据id找到用户信息
$check = $conn->query("select * from user where id=$id");
$res = $check->fetch(PDO::FETCH_ASSOC);



//找到所有用户信息，展示在联系人列表
$check_query = $conn->query("select * from user");
$result = $check_query->fetchAll(PDO::FETCH_ASSOC);

//注销登录
// if($_GET['action'] == 'logout'){
// 	session_start();
// 	unset($_SESSION['id']);
// 	session_destroy();
//     header('Location:index.php');	
// }

include 'onload.html';















